package com.lp.compt.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "ss_competition")
public class SsCompetitionEntity implements Serializable {
    private Integer id;
    private String cName;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private Date cStartTime;
    private String cSubject;
    private String cAdds;
    private Integer cNumbers;
    private Integer cLangt;
    private String cAbout;
    private String cUser;
    private String cPhone;
    private String cImage;
    private String cType;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "c_name")
    public String getcName() {
        return cName;
    }

    public void setcName(String cName) {
        this.cName = cName;
    }

    @Basic
    @Column(name = "c_start_time")
    public Date getcStartTime() {
        return cStartTime;
    }

    public void setcStartTime(Timestamp cStartTime) {
        this.cStartTime = cStartTime;
    }

    @Basic
    @Column(name = "c_subject")
    public String getcSubject() {
        return cSubject;
    }

    public void setcSubject(String cSubject) {
        this.cSubject = cSubject;
    }

    @Basic
    @Column(name = "c_adds")
    public String getcAdds() {
        return cAdds;
    }

    public void setcAdds(String cAdds) {
        this.cAdds = cAdds;
    }

    @Basic
    @Column(name = "c_numbers")
    public Integer getcNumbers() {
        return cNumbers;
    }

    public void setcNumbers(Integer cNumbers) {
        this.cNumbers = cNumbers;
    }

    @Basic
    @Column(name = "c_langt")
    public Integer getcLangt() {
        return cLangt;
    }

    public void setcLangt(Integer cLangt) {
        this.cLangt = cLangt;
    }

    @Basic
    @Column(name = "c_about")
    public String getcAbout() {
        return cAbout;
    }

    public void setcAbout(String cAbout) {
        this.cAbout = cAbout;
    }

    @Basic
    @Column(name = "c_user")
    public String getcUser() {
        return cUser;
    }

    public void setcUser(String cUser) {
        this.cUser = cUser;
    }

    @Basic
    @Column(name = "c_phone")
    public String getcPhone() {
        return cPhone;
    }

    public void setcPhone(String cPhone) {
        this.cPhone = cPhone;
    }


    @Basic
    @Column(name = "c_image")
    public String getcImage() {
        return cImage;
    }

    public void setcImage(String cImage) {
        this.cImage = cImage;
    }

    @Basic
    @Column(name = "c_type")
    public String getcType() {
        return cType;
    }

    public void setcType(String cType) {
        this.cType = cType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SsCompetitionEntity that = (SsCompetitionEntity) o;
        return id == that.id && Objects.equals(cName, that.cName) && Objects.equals(cStartTime, that.cStartTime) && Objects.equals(cSubject, that.cSubject) && Objects.equals(cAdds, that.cAdds) && Objects.equals(cNumbers, that.cNumbers) && Objects.equals(cLangt, that.cLangt) && Objects.equals(cAbout, that.cAbout);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, cName, cStartTime, cSubject, cAdds, cNumbers, cLangt, cAbout);
    }
}
